{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "class ExpectedReturns():\n",
    "    def __init__(self, prices):\n",
    "        self.prices = prices\n",
    "        '''\n",
    "        Calculates the expected returns of given assets.\n",
    "        Prices can be provided as a DataFrame in the following format, \n",
    "        whereas each column represents the price data of a single asset.\n",
    "        \n",
    "        Parameters\n",
    "        ----------\n",
    "        prices : pandas.DataFrame\n",
    "        \n",
    "                    AMZN         AAPL\n",
    "        Date\n",
    "        2019-05-13  1822.680054  184.026489\n",
    "        2019-05-14  1840.119995  186.939667\n",
    "        2019-05-15  1871.150024  189.179062\n",
    "        2019-05-16  1907.569946  188.346725\n",
    "        2019-05-17  1869.000000  187.276581\n",
    "        '''\n",
    "\n",
    "\n",
    "    def arithmetic(self, frequency=252):\n",
    "        #Needed for covariance matrix\n",
    "        arithm_returns = self.prices.pct_change().dropna(how='all')\n",
    "\n",
    "        #Needed for Efficient Frontier\n",
    "        mean_arithm_returns = arithm_returns.mean() * frequency\n",
    "        return arithm_returns, mean_arithm_returns\n",
    "\n",
    "\n",
    "    def geometric(self, frequency=252):\n",
    "        pass\n",
    "\n",
    "\n",
    "    def log(self, frequency=252):\n",
    "        #Needed for covariance matrix\n",
    "        log_returns = np.log(self.prices/self.prices.shift(1)).dropna(how='all')\n",
    "\n",
    "        #Needed for Efficient Frontier\n",
    "        mean_log_returns = log_returns.mean() * frequency\n",
    "        return log_returns, mean_log_returns\n",
    "\n",
    "\n",
    "    def network(self, future_days, frequency=252):\n",
    "        print('Neural network has been loaded, expected returns are being predicted')\n",
    "        pass"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
